﻿/* ----------------------------------------------------------------------------
 * Copyright (c) Philip Stears 
 *
 * This source code is subject to terms and conditions of the Microsoft Public 
 * License (Ms-PL).
 * 
 * By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 * 
 * To request a copy of the Microsoft Public License, send a request by email
 * to license@connectbasic.net.
 *
 * This notice must not be removed from this software.
 * ---------------------------------------------------------------------------- */

namespace ConnectBasic.Shell.Extensibility
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Provides a collection of states
    /// that the shell can be in.
    /// </summary>
    public interface IShellStateCollection : IEnumerable<IShellState>
    {

        /// <summary>
        /// Raised when the active state changes.
        /// </summary>
        event EventHandler ActiveStateChanged;

        /// <summary>
        /// Gets the current state the shell is in.
        /// </summary>
        IShellState ActiveState { get; }

        /// <summary>
        /// Gets the state at the given index.
        /// </summary>
        /// <param name="index">The index of the state to get.</param>
        /// <returns></returns>
        IShellState this[int index] { get; }

        /// <summary>
        /// Gets the state with the given name.
        /// </summary>
        /// <param name="invariantName">The invariant name of the state to get.</param>
        /// <returns></returns>
        IShellState this[string invariantName] { get; }

        /// <summary>
        /// Gets the number of states in the collection.
        /// </summary>
        int Count { get; }
    }
}
